<template>
    <div>
       <!-- <router-link :to="'/detail?tradeItemId='+itemid" tag="img" src="./images/btn.png"

       ></router-link> -->
       <img src="../../public/images/btn.png" @click="goToDetail(goods)">
    </div>
</template>
<script>
export default {
    props:{
        itemid:{
            type:String,
            default:""
        },
        goods:{
            type:Object,
            default(){
                return {}
            }
        }
    },
    methods:{
        goToDetail(arg){
            localStorage.setItem(arg.tradeItemId,JSON.stringify(arg));
            this.$router.push({
                path:"detail",
                query:{
                    tradeItemId:arg.tradeItemId
                }
            });
        }
    }
}
</script>
<style lang="less" scoped>
img {
    width: 20%;
    height: 20%;
    position: absolute;
    // top: 4.35rem;
    top: 80%;
    // left:2.8rem;
    // left: 2.1rem;
    left: 80%;
    // &::after {
    //     content: "";
    //     background-image: url("../../public/images/btn.png");
    // }
}
</style>